package com.betterjr.modules.profit.dubbo;

import com.alibaba.dubbo.config.annotation.Service;
import com.betterjr.common.web.AjaxObject;
import com.betterjr.modules.profit.IScfProfitService;
import com.betterjr.modules.profit.service.ScfLoanServiceService;
import com.betterjr.modules.profit.service.ScfLoanShareService;
import com.betterjr.modules.rule.service.RuleServiceDubboFilterInvoker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;


/**
 * Created by chenlj on 2018/6/28
 */
@Service(interfaceClass = IScfProfitService.class)
public class ProfitDubboService implements IScfProfitService {
    protected final Logger logger = LoggerFactory.getLogger(ProfitDubboService.class);

    @Autowired
    private ScfLoanServiceService scfLoanServiceService;
    @Autowired
    private ScfLoanShareService scfLoanShareService;

    @Override
    public String webQueryLoanShareList(Map<String, Object> anMap, int anFlag, int anPageNum, int anPageSize) {
//        anMap = (Map) RuleServiceDubboFilterInvoker.getInputObj();
        return AjaxObject.newOkWithPage("操作成功", scfLoanShareService.queryLoanShareList(anMap, anFlag, anPageNum, anPageSize)).toJson();
    }

    @Override
    public String webSaveConfirmLoanShareStatus(Map<String, Object> anMap) {
        return AjaxObject.newOk("操作成功", scfLoanShareService.saveConfirmLoanShareStatus(anMap)).toJson();
    }

    @Override
    public String webQueryLoanServiceList(Map<String, Object> anMap, int anFlag, int anPageNum, int anPageSize) {
        return AjaxObject.newOkWithPage("操作成功", scfLoanServiceService.queryLoanServiceList(anMap, anFlag, anPageNum, anPageSize)).toJson();
    }

    @Override
    public String webSaveConfirmLoanServiceStatus(Map<String, Object> anMap) {
        return AjaxObject.newOk("操作成功", scfLoanServiceService.saveConfirmLoanServiceStatus(anMap)).toJson();
    }

    @Override
    public String webQueryFundingPartyIndexData(Map<String, Object> anMap) {
        return AjaxObject.newOk("操作成功", scfLoanShareService.queryFundingPartyIndexData(anMap)).toJson();
    }
}
